package br.edu.infnet.model;

import java.io.Serializable;

import javax.persistence.*;

import org.dozer.DozerBeanMapper;
import org.dozer.Mapper;

import br.edu.infnet.dto.DataAniversarioDTO;

import java.math.BigDecimal;


/**
 * The persistent class for the data_aniversario database table.
 * 
 */
@Entity
@Table(name="data_aniversario")
@NamedQuery(name="DataAniversario.findAll", query="SELECT d FROM DataAniversario d")
public class DataAniversario implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="PK_DATA_CONTA")
	private int pkDataConta;

	@Column(name="DATA_ANIVERSARIO_CONTA")
	private String dataAniversarioConta;

	@Column(name="VALOR_DATA")
	private BigDecimal valorData;

	//bi-directional many-to-one association to Conta
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="FK_CONTA")
	private Conta conta;

	public DataAniversario() {
	}

	public int getPkDataConta() {
		return this.pkDataConta;
	}

	public void setPkDataConta(int pkDataConta) {
		this.pkDataConta = pkDataConta;
	}

	public String getDataAniversarioConta() {
		return this.dataAniversarioConta;
	}

	public void setDataAniversarioConta(String dataAniversarioConta) {
		this.dataAniversarioConta = dataAniversarioConta;
	}

	public BigDecimal getValorData() {
		return this.valorData;
	}

	public void setValorData(BigDecimal valorData) {
		this.valorData = valorData;
	}

	public Conta getConta() {
		return this.conta;
	}

	public void setConta(Conta conta) {
		this.conta = conta;
	}
	
	public static String getFindAll() {
		return "DataAniversario.findAll";
	}
	
	public DataAniversarioDTO toDTO() {
		DataAniversarioDTO dto = new DataAniversarioDTO();
		
		/*Mapper mapper = new DozerBeanMapper();
        dto = mapper.map(this, DataAniversarioDTO.class);*/
		
		dto.setConta(conta.toDTOLazy());
		dto.setDataAniversarioConta(dataAniversarioConta);
		dto.setPkDataConta(pkDataConta);
		dto.setValorData(valorData);
        
        return dto;
	}


}